home *** CD-ROM | disk | FTP | other *** search
- #!/bin/csh
- # kexec - recursive execution on the subdirectories
- # Usage: kexec command filekey arguments
- #
- # Note: filekey can be a part of file name.
- # command must be a single word command
- #
- set allfiles = `ls`
- set subfiles = `ls *$2*`
- set file =
- foreach file ($subfiles)
- if( -f $file) then
- $1 $file $[3-]
- endif
- end
-
- foreach file ($allfiles)
- if( -d $file) then
- cd $file
- echo cd $file
- kexec $*
- cd ..
- echo ..
- endif
- end
-